#!/bin/bash

COLOR=$1
EXT=$2

for FILE in muncher__*.svg; do
    NEWNAME=muncher$EXT$(echo $FILE |cut -c 8-)
	cat $FILE |sed "s/fill:#00f500/fill:#${COLOR}/g" > $NEWNAME
    if echo $NEWNAME |grep _right_; then
        ln -s $NEWNAME ${NEWNAME/_right_/_left_}
	ln -s $FILE ${FILE/_right_/_left_}
    fi
done
